{% load staticfiles %}
  <div class="topnews">
      <h2>最新文章</h2>

{% for article in articles %}
      <div class="blogs">
        <ul>
          <h3><a href="{% url 'article' %}?id={{article.id}}">{{article.title}}</a></h3>
          <p>{{ article.desc }}</p>
          <p class="autor">
	<span class="lm f_l">
	{% for tag in article.tag.all %}
	<a href="{% url 'tag_article' %}?tag_id={{tag.id}}">{{tag.name}}</a>
	{% endfor %}
	</span>
	<span class="dtime f_l">{{ article.date_publish | date:'Y-m-d'}}</span>
	<span class="viewnum f_r">浏览（<a href="/">{{ article.click_count }}</a>）</span>
	<span class="pingl f_r">评论（<a href="/">{{ article.comment_set.all.count }}</a>）</span>
	{% if tag_id == 2 %}
	<span class="pingl f_r"><a href="{% url 'article_delete' %}?id={{article.id}}">删除</a></span></p>
	{% endif %}

        </ul>
      </div>
{% endfor %}
   </div>
  <div id="pagination">
    <ul id="pagination-flickr">
	{% if page > 1 %}
    <li class="previous-off"><a href="?year={{year}}&&month={{month}}&&page={{page}}&&page_type=up&&tag_id={{tag_id}}&&category_id={{category_id}}">&laquo;上一页</a></li>
	{% endif %}
      <li class="active">{{page}}/{{paginator.num_pages}}</li>
	{% if page < paginator.num_pages %}
      <li class="next"><a href="?year={{year}}&&month={{month}}&&page={{page}}&&page_type=down&&tag_id={{tag_id}}&&category_id={{category_id}}">下一页 &raquo;</a></li>
	{% endif %}
   </ul>
   </div>

  </div>

